import http from "@/utils/fetch";

/**
 * 品类审核
 */
// 品类审核列表
export function categoryList(params) {
  return http.post("/Admin/CategoryExamine/categoryExamineList", params);
}
// 根据id编辑商户分类信息的审核状态(通过、拒绝)
export function editUserIscheck(params) {
  return http.post(
    "/Admin/CategoryExamine/editCategoryUserIscheck",
    params,
    true
  );
}
// 根据id删除商户分类信息
export function delUserInfo(params) {
  return http.post("/Admin/CategoryExamine/delCategoryUser", params, true);
}
// 根据member_id、category_id获取订单来源信息
export function getSourceInfo(params) {
  return http.get("/Admin/CategoryExamine/getSource", params);
}
// 根据idStr获取商户分类信息
export function getUserByIdStr(id) {
  return http.get(
    "/Admin/CategoryExamine/categoryUserByIdStr?idStr=377,376",
    { id: id },
    true
  );
}
// 根据member_id、category_id获取订单来源和费率信息
export function getSourceAndRate(params) {
  return http.get("/Admin/CategoryExamine/getSourceAndRate", params);
}
// 设置费率
export function setRate(params) {
  return http.post("/Admin/CategoryExamine/setRate", params, true);
}

/**
 * 商品审核
 */
// 商品审核列表
export function getGoodsCheckList(params) {
  return http.post("/Admin/GoodsCheck/getGoodsCheckList", params);
}
// 商品审核通过
export function goodsCheckPass(ids) {
  return http.post("/Admin/GoodsCheck/goodsCheckPass", { goods_id: ids }, true);
}
// 商品下架审核列表
export function getGoodsShelfCheckList(params) {
  return http.post("/Admin/GoodsCheck/getGoodsShelfCheckList", params);
}
// 查看商品详情
export function getGoodsInfo(id) {
  return http.get("/Admin/Goods/getGoodsInfo", { goods_id: id });
}
// 商品审核拒绝
export function goodsCheckRefuse(params) {
  return http.post("/Admin/GoodsCheck/goodsCheckRefuse", params);
}
// 商品下架审核通过
export function goodsShelfCheckPass(ids) {
  return http.post(
    "/Admin/GoodsCheck/goodsShelfCheckPass",
    { goods_id: ids },
    true
  );
}
// 商品审核拒绝
export function goodsShelfCheckRefuse(params) {
  return http.post("/Admin/GoodsCheck/goodsShelfCheckRefuse", params);
}
// 商品列表
export function getGoodsAll(params) {
  return http.post("/Admin/Goods/getGoodsAll", params);
}
// 获取设置活动
export function getActivityList(id) {
  return http.get("/Admin/Goods/getActivityList", { goods_id: id });
}
// 设置活动
export function addActivity(params) {
  return http.post("/Admin/Goods/addActivity", params);
}
// 商品分享
export function goodsShare(id) {
  return http.get("/Admin/Goods/goodsShare", { goods_id: id });
}
// 商品下架
export function itemDownShelf(params) {
  return http.post("/Admin/Goods/itemDownShelf", params, true);
}
// 商品上架
export function goodsGrounding(id) {
  return http.post("/Admin/Goods/goodsGrounding", { goods_id: id }, true);
}
// 获取所有申请品类
export function getShopCategory(id) {
  return http.get("/Admin/Goods/getShopCategory", { goods_id: id });
}
// 获取所有商品品类
export function getCategory() {
  return http.get("/Admin/Goods/getCategory");
}
// 获取商品服务城市
export function getGoodsAreas() {
  return http.get("/Admin/Goods/getGoodsAreas");
}
// 获取商品添加各参数
export function getGoodsRentData() {
  return http.get("/Admin/Goods/getGoodsRentData");
}
// 编辑获取商品基础信息
export function getGoodsData(id) {
  return http.get("/Admin/Goods/getGoodsData", { goods_id: id });
}
// 通过分类id获取商品参数
export function getGoodsParameter(id) {
  return http.post("/Admin/Goods/getGoodsParameter", { cate_id: id });
}
// 编辑获取商品套餐列表
export function getGoodsSetmealList(id) {
  return http.get("/Admin/Goods/getGoodsSetmealList", { goods_id: id });
}
// 套餐获取参数
export function getParameterList() {
  return http.get("/Admin/Goods/getParameterList");
}
// 编辑获取套餐信息
export function getGoodsSetmealInfo(id) {
  return http.get("/Admin/Goods/getGoodsSetmealInfo", { setmeal_id: id });
}
// 编辑商品基础信息
export function editGoodsData(params) {
  return http.post("/Admin/Goods/editGoodsData", params);
}
// 编辑套餐信息
export function editGoodsSetmeal(params) {
  return http.post("/Admin/Goods/editGoodsSetmeal", params);
}
// 提现审核列表
export function withdrawalExamineList(params) {
  return http.post("/Admin/Withdrawal/withdrawalExamineList", params);
}
// 提现审核通过
export function withdrawalPass(params) {
  return http.post("/Admin/Withdrawal/withdrawalPass", params, true);
}
// 获取提现审核验证码
export function getExamineMobile() {
  return http.post("/Admin/Withdrawal/getExamineMobile");
}
// 提现审核拒绝
export function withdrawalRefuse(params) {
  return http.post("/Admin/Withdrawal/withdrawalRefuse", params, true);
}
// 提现审核列表导出
export function withdrawalExamineListExport(params) {
  return http.export(
    "/Admin/Withdrawal/withdrawalExamineListExport",
    params,
    "提现审核列表"
  );
}

/**
 * 供应商审核
 */
// 供应商审核列表
export function supplierCheckList(params) {
  return http.post("/Admin/SupplierCheck/supplierCheckList", params);
}
// 根据id查看供应商信息
export function shopUserById(id) {
  return http.get("/Admin/SupplierCheck/shopUserById", { id });
}
// 根据id编辑供应商信息
export function editShopUserById(params) {
  return http.post("/Admin/SupplierCheck/editShopUserById", params, true);
}
// 根据id编辑审核状态(通过)
export function editShopUserStatus(id) {
  return http.post(
    "/Admin/SupplierCheck/editShopUserStatus",
    { id, status: 1 },
    true
  );
}
// 根据id删除供应商信息
export function delShopUser(id) {
  return http.post("/Admin/SupplierCheck/delShopUser", { id }, true);
}
